import HTTP from "@/http";

const $h = new HTTP({
    timeout: 5000,
    baseURL: import.meta.env.VITE_BACK_API_URL
});
// 登录
export const loginApi = (data: LoginParams) => {
    return $h.post("/login", data);
};
// 获取个人信息(内容神器)
export const getUserInfoApi = (username: string) => {
    return $h.get("/user-info", { username });
};
// 获取用户组(内容神器)
export const getUserGroupApi = () => {
    return $h.get<ResponseType.MethodGet.UserGroupApi>("/user-groups");
};
// 获取用户列表(内容神器)
export const getUsersApi = () => {
    return $h.get("/users");
};
// 更新网站模版
export const updateWebsiteTplApi = (params:{tpl_type:"pc"|"m",tpl_id:number,ids:number[]}) => {
    return $h.post("/tpl_update",params,{},{timeout:100000});
};
// 获取模版列表
export const getWebsiteTplListApi = () => {
    return $h.get("/tpl_list",{},{},{timeout:100000});
};
